<template>
    <div>
        <div class="crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <i class="el-icon-lx-calendar"></i> 表单
                </el-breadcrumb-item>
                <el-breadcrumb-item>基本表单</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <div class="container">
            <div class="form-box">
                <el-form ref="form" :model="form" label-width="80px">
                    <el-form-item label="商品名称">
                        <el-input v-model="form.commodityName"></el-input>
                    </el-form-item>
                      <el-form-item label="商品价格">
                        <el-input v-model="form.commoditySalePrice"></el-input>
                    </el-form-item>
                        <el-form-item label="商品描述">
                        <el-input v-model="form.commodityDetails"></el-input>
                    </el-form-item>
                        <el-form-item label="商品如图片">
                        <el-input v-model="form.commodityImg"></el-input>
                    </el-form-item>
                        <el-form-item label="点赞评论数">
                        <el-input v-model="form.commentCount"></el-input>
                    </el-form-item>
                        <el-form-item label="商品销量">
                        <el-input v-model="form.commoditySaleNum"></el-input>
                    </el-form-item>
                        <el-form-item label="商品游览量">
                        <el-input v-model="form.commodityBorwseNum"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="onSubmit">修改</el-button>
                        <el-button>取消</el-button>
                    </el-form-item>
                </el-form>
            </div>
        </div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    name: 'upload',
    data() {
        return {
          
            form: {
           
            }
        };
    },
    methods: {
        onSubmit() {
axios({url:"http://localhost:59475/api/add",method:"post",data:this.form}).then((res)=>{//修改
  if(res.data>0)
  {

 this.$message.success('修改成功！');
this.$router.puhs('/basetable')
  }
}) 




           
        }
    }
};
</script>